package com.test.service.impl;

import com.test.mapper.UserMapper;
import com.test.model.User;
import com.test.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;
    @Override
    public void save(User user) {
        userMapper.save(user);

    }

    @Override
    public boolean update(User user) {

        return userMapper.update(user);
    }

    @Override
    public boolean delete(int id) {
        return userMapper.delete(id);
    }

    @Override
    public User findById(int id) {

        return  userMapper.findById(id);
    }

    @Override
    public List<User> findAll() {

        return userMapper.findAll();
    }
}
